﻿<%@ Page Title="Create Report" Language="C#" MasterPageFile="~/MasterPage.master"
	AutoEventWireup="true" CodeFile="Create_Report.aspx.cs" Inherits="admin_Create_Report" %>

<asp:Content ID="Head" ContentPlaceHolderID="head" runat="Server">
	<link href="../styles/admin.css" rel="stylesheet" type="text/css" />

	<script src="../javascripts/jquery-1.4.3.min.js" type="text/javascript"></script>

	<script src="../javascripts/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(function () {
                $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' });
            });
    </script>

	<script type="text/javascript">
		function showSites(str) {
			if (str == "") {
				document.getElementById("txtHint").innerHTML = "";
				return;
			}
			if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp = new XMLHttpRequest();
			}
			else {// code for IE6, IE5
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.onreadystatechange = function() {
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
					document.getElementById("client_id").innerHTML = str;
				}
			}
			SitesObjectDataSource.SelectParameters["client_id"].DefaultValue = str;
			xmlhttp.open("GET", "Create_Repport.aspx?client_id=" + str, true);
			xmlhttp.send();
		}
	</script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
	<div id="top_menu">
		<div id="help_button">
			help
		</div>
		<div id="logout">
			<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="../Default.aspx"
				OnLoggingOut="LoginStatus1_LoggingOut" />
		</div>
	</div>
	<div id="page_title">
		ADMINISTRATION
	</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
	<div id="left_content">
		<div class="menu">
			<ul>
				<li><a href="Home.aspx">Home</a></li>
				<li><a href="Mng_Client.aspx">Manage Clients</a></li>
				<li><a href="Mng_Site.aspx">Manage Sites</a></li>
				<li><a href="Mng_Machine.aspx">Manage Machines</a></li>
				<li><a href="Mng_Comp.aspx">Manage Components</a></li>
				<li><a href="#" class="current">Create New Report</a></li>
				<li><a href="Mng_WO.aspx">Manage Work Order</a></li>
				<li><a href="Mng_FaultsRecom.aspx">Manage Faults Recommendation</a></li>
			</ul>
		</div>
	</div>
	<!-- end of left content -->
	<div id="right_content">
		<div class="content_area">
			<h2>
				Create New Report
			</h2>
			<h3>
				<asp:Label ID="componentNameLabel" runat="server" Text="Specify Client" Visible="False"></asp:Label>
			</h3>
			<div class="form_box1">
				<table id="selecttable" runat="server">
					<tr>
						<td class="label">
							Select Client:
						</td>
						<td>
							<asp:DropDownList ID="Selectclient_DropDownList1" AutoPostBack="true" runat="server"
								OnSelectedIndexChanged="Client_changed" DataTextField="clientName" DataValueField="clientid"
								CssClass="dropDownList">
							</asp:DropDownList>
						</td>
					</tr>
					<tr>
						<td class="label">
							Select Area:
						</td>
						<td>
							<asp:UpdatePanel runat="server">
								<ContentTemplate>
									<asp:DropDownList ID="AreaDropDownList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="AreaDropDownList_SelectedIndexChanged"
										CssClass="dropDownList">
									</asp:DropDownList>
								</ContentTemplate>
								<Triggers>
									<asp:AsyncPostBackTrigger ControlID="Selectclient_DropDownList1" />
								</Triggers>
							</asp:UpdatePanel>
						</td>
					</tr>
					<tr>
						<td class="label">
							Select Sites:
						</td>
						<td>
							<asp:UpdatePanel ID="upnl" runat="server">
								<ContentTemplate>
									<asp:CheckBoxList ID="SitesCheckBoxList" runat="server" CssClass="checkBox">
									</asp:CheckBoxList>
								</ContentTemplate>
								<Triggers>
									<asp:AsyncPostBackTrigger ControlID="Selectclient_DropDownList1" />
									<asp:AsyncPostBackTrigger ControlID="AreaDropDownList" />
								</Triggers>
							</asp:UpdatePanel>
						</td>
					</tr>
					<tr>
						<td class="label">
							Date of Survey:
						</td>
						<td>
							<asp:TextBox ID="DateTextBox" class="datepicker" runat="server"></asp:TextBox>
						</td>
					</tr>
					<tr>
						<td>
						</td>
						<td>
							<asp:CheckBox ID="CheckBox_OldReport" runat="server" Text="Using Old Reports" CssClass="checkBoxL" />
						</td>
					</tr>
					<tr>
						<td>
							<asp:LinkButton ID="LinkButton1" runat="server" 
								PostBackUrl="~/admin/Mng_Report.aspx">Manage Reports</asp:LinkButton>
						</td>
						<td>
							<asp:Button ID="submit_button" runat="server" Text="Next" OnClick="submit_button_Click"
								CssClass="buttons" />
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</asp:Content>
